package fivecardstudd;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Random;

public class Deck {

	
	private ArrayList<Card> deck;
    
    private int numberOfCards;
     
     public Deck() {
         deck = new ArrayList<Card>();
         
         for (Card.CardSuitEnum suit : Card.CardSuitEnum.values()) {
                 for (Card.CardRankEnum rank : Card.CardRankEnum.values()) {
                         deck.add(new Card(rank, suit));
                          }
                      }
         
              Collections.shuffle(deck, new Random(System.currentTimeMillis()));
              numberOfCards = deck.size();            
         }
	
     
        public int getNumberOfCards() {
         return numberOfCards;
            }


       public void shuffle() {
         Collections.shuffle(deck);
             }
 
     public Card drawCard(){
         numberOfCards--;
         return deck.remove(0);
          }
     
    }